<?php

	define('ABSOLUTE_SERVER_REMOTE_ADDR','../../');
	define('ABSOLUTE_SERVER_DOCUMENT_ROOT','../../');

    if(file_exists('../../../definitions.inc.php')) include_once('../../../definitions.inc.php');
    include(ABSOLUTE_SERVER_DOCUMENT_ROOT.'session.inc');    
    require_once(ABSOLUTE_SERVER_DOCUMENT_ROOT.'funct.inc');   
    require_once(ABSOLUTE_SERVER_DOCUMENT_ROOT.'functs.inc');
    if(!GetAdminID($ID)){echo LOGIN_ERR;exit;}
    if(!Right_Check(5)){header('Location:'.ABSOLUTE_SERVER_DOCUMENT_ROOT.'error.php');exit;}
    include ABSOLUTE_SERVER_DOCUMENT_ROOT.'color_style.php'; 
    include ABSOLUTE_SERVER_DOCUMENT_ROOT.LANGUAGE;
    require_once('../../../classDB.inc.php');
    
    $_DB = new classDB();
    if (!$_DB->open()){echo OPEN_DB_ERR; break;}
    
?>
<html>
<head>
        <?php echo '<meta http-equiv="Content-Type" content="text/html; charset='._CHARSET_.';">'; ?>

        <style  type="text/css"><!--
                table{
                        border-bottom-color: white;
                        border-top-color: black;
                        border-left-color: white;
                        border-right-color: white;
                        border-collapse: collapse;
                }
                input {
                        border: 0px;
                        cursor: hand;
                        height: 15px;
                        background-color: transparent;
                        font-size: 10px;
                        margin-left: 0px;
                        padding-left: 0px;
                        list-style-type: none;
                        font-family:  Verdana;
                        text-align:left;
                        margin-top:0pt;
                        margin-bottom:0px;
                }
                form {margin-top:0pt; margin-bottom:0px;}
                img {margin-top:0pt; margin-bottom:0px;}
                body{
                        margin-left:0pt;
                        margin-right:0pt;
                        margin-top:0pt;
                        margin-bottom:0pt;
                        background-position:  15px 170px;
                        background-repeat:    no-repeat;
                }


        --></style>
</head>

<?php
print "<body  background=\"brush.jpg\" bgcolor=\"".Background_Color."\">";


$roll_menu=rutine_menu($_REQUEST["roll_menu"],$_REQUEST["ID"]);
                 
        print "<b><font style=\"font-size:10px; font-family:verdana; position:absolute; left:2px; top:20px;\">".UTM_KATEGORIE_UZIVATELSKEHO_MENU.":</font></b>";

        print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"position:absolute; left:0px; top:42px;\">";
        //**********************************************************************
        //
        //ROZROLOVANIE MENU PRI VYKRESLOVANI STRANKY - TOP MENU
        //
        //**********************************************************************
        $sql_topmnu= "SELECT * FROM top_menu_top_category ORDER BY TC_Show_No,TC_Caption";
        $TMnu_Source=mysql_query($sql_topmnu);
        while($sql_array_TMnu = mysql_fetch_object($TMnu_Source))
          {

                print "<tr>";
               // print "<td colspan=\"2\">";
		print "<td background=\"../../tien_menu_static.bmp\" style=\"background-repeat:repeat-x;background-position:0px 0px;\">"; //colspan


                if($sql_array_TMnu->TC_Have_SC==1){  //ak existuje podmenu - form odkazuje na svoju vlastnu stranku, do ktorej sa zaznamena ID Top menu
                    print "<form action=\"adm_informations_big_menu.php\" method=\"post\">";
                    print "<input type=\"hidden\" value=\"".$sql_array_TMnu->ID."\" name=\"ID\" />";
                }
                else                                //ak neexistuje podmenu
                {
                    $sql_submnu= "SELECT * FROM top_menu_sub_category WHERE TC_ID=".$sql_array_TMnu->ID;
                    $SMnu_Source=mysql_query("$sql_submnu");
                    $sql_array_SMnu = mysql_fetch_object($SMnu_Source);
                    print "<form action=\"adm_informations_big_text.php\" target=\"contents\" method=\"post\">";
                    print "<input type=\"hidden\" value=\"".$sql_array_SMnu->ID."\" name=\"ID\" />";
                    print "<input type=\"hidden\" value=\"".$sql_array_TMnu->TC_Caption."\" name=\"path\" />";
                }

                //nastavenie tlacitka
                print "<input type=\"submit\" value=\"".$sql_array_TMnu->TC_Caption."\" style=\"width :150px\";";
                print " onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bolder';\"";
                print " onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />";

                print "<input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />";
                print "<input type=\"hidden\" value=\"".$_REQUEST['ProductID']."\" name=\"ProductID\" />";

                print "</form>";
                print "</td>";
                print "</tr>";

                //**************************************************************
                //
                //ak existuje SUB MENU a je rozrolovane
                //
                //**************************************************************
                //tu sa vytvara zoznam formularov - zobrazenych ako podmenu
                 if(is_roll($roll_menu,$sql_array_TMnu->ID))
                 {
                  $sql_submnu= "SELECT * FROM top_menu_sub_category WHERE TC_ID=".$sql_array_TMnu->ID." ORDER BY SC_Show_No,SC_Caption";
                  $SMnu_Source=mysql_query("$sql_submnu");
                   while($sql_array_SMnu = mysql_fetch_object($SMnu_Source))
                   {
                      print "<tr>";
                              print "<td align=\"right\" background=\"../../tien_menu_roll_down.bmp\" style=\"background-repeat:repeat;background-position:0px 0px;\">";
                        
                                print "<form action=\"adm_informations_big_text.php\" target=\"contents\" method=\"post\">";
                                    print "<input type=\"submit\" value=\"".$sql_array_SMnu->SC_Caption."\" style=\"width :135px\";";
                                        print " onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"";
                                        print " onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />";
                                    print "<input type=\"hidden\" value=\"".$sql_array_SMnu->ID."\" name=\"Type_ID\" />";
                                    print "<input type=\"hidden\" value=\"MENU\" name=\"Type\" />";
                                    print "<input type=\"hidden\" value=\"$roll_menu\" name=\"roll_menu\" />";
                                print "</form>";
                              print "</td>";
                            print "</tr>";
                   }
                  }
         }
         print "</table>";
         mysql_close();
?>
</body>
</html>
</body>
</html>
